// 管理员模型
const mongoose = require('./db')
const Schema = mongoose.Schema

let Admin = new mongoose.Schema({
    username: { type: String, required: true, index: true, display: '用户名' },
    payment: [ { type: Schema.Types.ObjectId, ref: 'coupon', display: '优惠' } ]
  },
  {
    collection: 'admin',
    timestamps: {
      createAt: true,
      updateAt: true,
    }
  })

module.exports = mongoose.model('admin', Admin)
